<?php
/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
*/



    $hisite=$_GET['site'];
    
    $sql = "SELECT siteID, siteNAME FROM Site";
    $result = mysql_query($sql);
    $options='';
    while ($row = mysql_fetch_array($result)) {
        $id = $row["siteID"];
        $thing = $row["siteNAME"];

        $p1 = '&plugin=';
        $p2 = '&page=';
        $p1 .= $_GET['plugin'];
        $p2 .= $_GET['page'];
        $p1 .= $p2;

        $opt = '"index2.php?site=';
        $opt .= $id;
        $opt .= $p1;

        if ($id == $hisite) {
            $opt .= '" SELECTED>';
        }else {
            $opt .= '">';
        }
        $options .= '<OPTION VALUE=' . $opt . $thing;
    }

    echo '

<script type="text/javascript">
function goThere(loc)
{
window.location.href=loc;
}
</script>

<form name="sitepicker">
<select onchange="goThere(this.options[this.selectedIndex].value)" size="1">
<OPTION VALUE="">Select Site...';
    echo $options;

    echo'
</select>
<a href="index2.php?site=' , $hisite , '&plugin=base&page=newsite">New Site</a>
</form>';

?>
